/**
 * 将时间对象转换成字符串 
 * @param now
 * @returns
 */
function dateToString(now){  
    var year = now.getFullYear();  
    var month =(now.getMonth() + 1).toString();  
    var day = (now.getDate()).toString();  
    var hour = (now.getHours()).toString();  
    var minute = (now.getMinutes()).toString();  
    var second = (now.getSeconds()).toString();  
    if (month.length == 1) {  
        month = "0" + month;  
    }  
    if (day.length == 1) {  
        day = "0" + day;  
    }  
    if (hour.length == 1) {  
        hour = "0" + hour;  
    }  
    if (minute.length == 1) {  
        minute = "0" + minute;  
    }  
    if (second.length == 1) {  
        second = "0" + second;  
    }  
     var dateTime = year + "-" + month + "-" + day +" "+ hour +":"+minute+":"+second;  
     return dateTime;  
  }  

/**
 * 字符串转时间格式
 * @param strDate
 * @returns
 */
function getDate(strDate) { 
	  var st = strDate; 
	  var a = st.split(" "); 
	  var b = a[0].split("-"); 
	  var c = a[1].split(":"); 
	  var date = new Date(b[0], b[1], b[2], c[0], c[1], c[2]);
	  return date; 
} 

/**
 * 判断输入框输入是否为空
 * @param inputs 所有require='true'的input
 * @returns val()值为空的input
 */
function checkEmpty(inputs){
	var err = [];
	inputs.each(function(){
//		debugger;
		var str = $(this).val();
		if(str == null || str == "" || str.length < 1){
			err.push($(this));
		}
	});
	return err;
}

